package com.yan.scanner.demo;

import java.util.Scanner;

public class ScannerDemo1 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("输入年龄");
        int age = input.nextInt();
        System.out.println(age);
        System.out.println("-------------------");
        // 定义常量3.14
        // 定义半径变量r
        int radius;
        // 定义周长，面积变量
        double c, s;
        Scanner scanner = new Scanner(System.in);
        System.out.println("输入半径");
        radius = scanner.nextInt();
        // 计算周长
        c = 2 * Math.PI * radius;
        System.out.println("周长 = " + c);
        // 计算面积
        s = Math.PI * radius * radius;
        System.out.println("面积 = " + s);
    }
}
